package structure;

public class Map {
	private final int size[];
	private SectorBuffer buffer;
	
	public Map(int size[],String name){
		this.size = size;
		buffer = new SectorBuffer(getWidth(),getHeight(),10,name);
	}
	
	

	public byte getBlock(int[] position){
		return buffer.getSector(position).getBlock(position);
	}
	
	public void setBlock(int[] position,byte value){
		buffer.getSector(position).setBlock(position,value);
	}
	
	public int getWidth(){
		return size[0];
	}
	
	public int getHeight(){
		return size[1];
	}
	
	public int getDepth(){
		return size[2];
	}
	
	public void save()
	{
		try {
			buffer.save();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
